package com.shenganyuan.smac.common.data;

import com.oklib.utils.pref.AnyPref;
import com.shenganyuan.smac.common.beans.LocationInfo;

/**
 * Created by Damon.Han on 2018/3/9 0009.
 *
 * @author Damon
 */

public class AnyPrefUtil {
    public static void saveLocationInfo(LocationInfo locationInfo) {
        if (locationInfo == null) {
            return;
        }
        if ("0.0".equals(locationInfo.longitude) || "0.0".equals(locationInfo.latitude)) {
            return;
        }
        AnyPref.put(locationInfo, "locationInfo");
    }

    public static LocationInfo getLocationInfo() {
        LocationInfo locationInfo = AnyPref.get(LocationInfo.class, "locationInfo");
        return locationInfo;
    }
}
